package com.aniu.smslisten.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.aniu.smslisten.service.SmsListenService;

/**
 * 系统重启后启动应用
 */
public class BootCompletedReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
            Intent serviceIntent = new Intent(context, SmsListenService.class);
            context.startForegroundService(serviceIntent);
        }
    }
}